function runall(graph, am1, al1, am2, al2, am3, al3, convfile, convto, datafile)

% ----------------------------------------------
% This function runs the model if the user needs
% to start from the beginning.  It will do the
% following:
%   (1) get nodes from graph
%   (2) extract subnetworks from given networks
%   (3) create adjacency lists from the
%       given adjacency matrices
%   (4) use numbers in the adjacency lists
%       instead of strings
%   (5) run the model
%
% USAGE:
% runall(graph, adjmat1, adjlabels1,
%    adjmat2, adjlabels2, adjmat3, adjlabels3,
%    conversion_file, convert_to, datafile)
%-----------------------------------------------

% Extract the nodes from a gml graph

q = import_yed(graph);
genes = extract_nodes(q);

% Convert all to necessary type
% ------Skip this for now

if strcmp(convto, 'none')
    disp('Skipped conversion.');
else
    disp(['Converted all the labels to ' convto '.']);
end

fprintf('\n');

% Just get the desired subnetwork.

[small_am1, small_al1] = get_submatrix(am1, al1, genes);
[small_am2, small_al2] = get_submatrix(am2, al2, genes);
[small_am3, small_al3] = get_submatrix(am3, al3, genes);

% Convert to adjacency lists.

[adjlist1] = get_adjlist(small_am1, small_al1);
[adjlist2] = get_adjlist(small_am2, small_al2);
[adjlist3] = get_adjlist(small_am3, small_al3);

% Order and number adjacency lists

[adjlist1] = order_list(adjlist1, genes);
[adjlist2] = order_list(adjlist2, genes);
[adjlist3] = order_list(adjlist3, genes);

% Get the values.

yreal = [];
yfake = [];

for i = 1:length(genes)
    [s lists] = system(['perl "' which('get_uniqids.pl') '" "' which(convfile) '" ' genes{i}]);
    if strcmp(lists, 'nothing'), disp('Figure something out'); end;
    eval(['mylist = {' lists(1:end-1) '};']);
    vals = get_values(mylist, datafile);
    yreal(i,:) = vals(1,:);
    yfake(i,:) = vals(2,:);
end